<?php
namespace app\admin\model\system;
use think\Model;
use think\facade\Db;
use app\common;
class Region extends Model {
	private $table_obj;
	public function getRegion($where,$field='*'){
		extract(common::get('region',[$where,$field,__function__]));
		
		if(empty($data)){
			$data=Db::name("region")->where($where)->field($field)->find();
			common::set($data);
		}
		return $data;
	}
	
	public function selectRegion($where,$field){
		extract(common::get('region',[$where,$field],__function__));
		if(empty($data)){
			$result=Db::name("region")->where($where)->field($field)->select();
			if($result){
				common::set($result->toArray());
				$data=$result->toArray();
			}
		}
		return $data;
	}
	
	public function getSql(){
		return Db::getLastSql();
	}
}
?>